/*
 * MobileLoadingView.fx
 *
 * Created on 06/05/2009, 19:05:36
 */

package webooksfx_desktop.view;

import javafx.scene.Group;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.Node;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import webooksfx.view.LoadingView;
import webooksfx_desktop.view.components.ViewMessage;


/**
 * @author matias
 */

public class DesktopLoadingView extends LoadingView {
	public var closeAction: function();
	var view_msg: ViewMessage = null;

	override public function showException (msg: String) : Void {
		view_msg = ViewMessage {
			type_msg: ViewMessage.ERROR
			x: -45
			y: 125
			text: msg
			action: function(): Void {
				this.closeAction();
			}
		}
		view_msg.show();
	}

    public override function create(): Node {
        this.node = Group {
            visible: true;
            translateX: 0;
            translateY: 200;
            content: [
				ImageView {
                    image: Image {
                        url: "{__DIR__}images/load_app.png"
                    }
                },
				Group {
					translateX:170
					content: bind view_msg;
				}
            ]
        };
        return node;
    }
}